<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./vue.js"></script>
</head>
<body>
  <div id="app">
    <ul>
      <li v-for="(film,index) in films" :key="film.filmId">
        <h5>
          电影名：{{ film.name }}
        </h5>
        <p>
          简介：{{ film.synopsis }}
        </p>
        <p>
          <img :src="film.poster" alt="">
        </p>
        <p>
          类型：
          {{ film.item.name }}
        </p>
      </li>
    </ul>
  </div>
  <script>
    let vm = new Vue({
      el:"#app",
      data:{
        films:[]
      },
      created(){
        this.fetchFilms();
      },
      methods:{
        fetchFilms(){// 请求数据方法
          fetch("https://m.maizuo.com/gateway?cityId=110100&pageNum=1&pageSize=10&type=1&k=492559",{
            headers:{
              "X-Client-Info":'{"a":"3000","ch":"1002","v":"5.0.4","e":"1597720815568988677439489","bc":"110100"}',
              "X-Host":"mall.film-ticket.film.list"
            },
            method:"GET"
          }).then(res=>res.json()).then(res=>{
            if(res.status === 0){
              console.log(res)
              this.films = res.data.films
            }
          })
        }
      }
    })

   
  </script>
</body>
</html>